cmake_minimum_required(VERSION 3.5) # CMake install : https://cmake.org/download/
project(D3GUITool LANGUAGES CXX)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_PREFIX_PATH "D:/Qt/Qt5.14.2/5.14.2/msvc2017_64") # Qt Kit Dir
set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
# set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(QRC_FILE ${CMAKE_SOURCE_DIR}/assets/assets.qrc)
find_package(Qt5 COMPONENTS Widgets REQUIRED) # Qt COMPONENTS
aux_source_directory(./src srcs)
qt5_add_resources(QRC ${QRC_FILE})

# Specify MSVC UTF-8 encoding   
add_compile_options("$<$<C_COMPILER_ID:MSVC>:/utf-8>")
add_compile_options("$<$<CXX_COMPILER_ID:MSVC>:/utf-8>")

set(OpenCV_DIR D:/opencv/x64/vc15/lib)
find_package(OpenCV REQUIRED)

file(GLOB_RECURSE VTKLIBS D:/VTK-8.2.0-release/lib/*.lib)
include_directories(D:/VTK-8.2.0-release/include/vtk-8.2)

file(GLOB_RECURSE SRC ${CMAKE_SOURCE_DIR}/src/*.*)
file(GLOB_RECURSE HEAD ${CMAKE_SOURCE_DIR}/src/*.h)
file(GLOB_RECURSE LIB ${CMAKE_SOURCE_DIR}/lib/*.lib)
file(COPY ${HEAD} DESTINATION ${CMAKE_SOURCE_DIR}/include)

include_directories(${CMAKE_SOURCE_DIR}/include)

add_executable(${PROJECT_NAME}
    WIN32 # If you need a terminal for debug, please comment this statement 
    ${SRC}
    ${QRC}
    icon.rc
)

target_link_libraries(${PROJECT_NAME} PRIVATE Qt5::Widgets ${OpenCV_LIBS} ${LIB} ${VTKLIBS}) # Qt5 Shared Library





